home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 45
/
Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso
/
Aminet
/
game
/
role
/
ldmud-3.2-bin.lha
/
mud
/
doc
/
master
/
flag
< prev
next >
Wrap
Text File
|
2001-04-06
|
1KB
|
42 lines
SYNOPSIS
void flag(string arg)
DESCRIPTION
Evaluate an argument given as option '-f' to the driver.
If several '-f' options are given, this function will be
called sequentially with all given arguments.
This function can be used to pass the master commands via
arguments to the driver. This is useful when building a new
mudlib from scratch. It is called only when the system is
started.
EXAMPLE
// The code given implements these commands:
// '-fcall <ob> <fun> <arg>': call function <fun> in object <ob> with
// argument <arg>.
// '-fshutdown': shutdown the system immediately.
// Thus, starting the driver as
// 'parse "-fcall foo bar Yow!" -fshutdown' would
// first do foo->bar("Yow!") and then shut down the system.
{
string obj, fun, rest;
if (arg == "shutdown")
{
shutdown();
return;
}
if (sscanf(arg, "call %s %s %s", obj, fun, rest) >= 2)
{
write(obj+"->"+fun+"(\""+rest+"\") = ");
write(call_other(obj, fun, rest));
write("\n");
return;
}
write("master: Unknown flag "+arg+"\n");
}
SEE ALSO
master(M)